package org.artifact.core.plugin.netty.session;

import org.artifact.core.context.session.ISession;
import org.artifact.core.context.session.ISessionFactory;
import org.artifact.core.plugin.netty.packet.NettyPacketUtil;

import io.netty.channel.Channel;

public class NettySessionFactory implements ISessionFactory<Channel> {

	public ISession createSession(Channel channel) {
		NettySession session = new NettySession(channel);
		session.setAttr(NettySessionAttrEnum.ENCRYPT_KEY_SECRET, NettyPacketUtil.getDefaultCustomEncryptionKeys());
		session.setAttr(NettySessionAttrEnum.DECRYPT_KEY_SECRET, NettyPacketUtil.getDefaultCustomDecryptionKeys());
		
		return session;
	}

}
